﻿#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int k;
	scanf("%d", &k);
	int sum = 0,n=1,add=0;
	while (add<=k)//第一个阶段送一天，每天一金币，第二阶段送两天，每天两金币
	{				//假设k为第n阶段
		add += n;
		sum += n * n;//统计到n+1阶段金币数
		n++;		 //变为n+2阶段
	}
	sum = sum - (n - 1) * (add - k);//到n+1阶段金币数减去n+1阶段金币为到n阶段金币
	printf("%d", sum);
	return 0;
}